<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>演示计算属性</title>
    <script src="./js/vue@3.5.12.global.js"></script>
</head>
<body>
    <div id="app">
        <h3>{{rePrice}}</h3>
    </div>
</body>
<script>
    const app = Vue.createApp({
        data(){
            return {
                price: 1.3
            }
        },
        //计算属性，不是函数
        computed:{
            rePrice(){
                return '￥'+this.price.toFixed(2)+'元'
            }
        }
    })
    app.mount('#app');
</script>
</html>